Fix functionality of capturing with camera