Fixed PORTs and added double checking in operations