added take photo function